package kr.hkit.powerjava.chapter12.submit; //프로그래밍 1

import java.util.Random;

class Rectangle implements Movable {

	@Override
	public void move(int dx, int dy) {
		System.out.println("사각형이 " + "X:" +dx + ",Y:" + dy + " 지점으로 이동하였습니다.");
	}
}

class Circle implements Movable {

	@Override
	public void move(int dx, int dy) {
		System.out.println("원이 " + "X:" +dx + ",Y:" + dy + " 지점으로 이동하였습니다.");
	}
}

class Triangle implements Movable {

	@Override
	public void move(int dx, int dy) {
		System.out.println("삼각형이 " + "X:" +dx + ",Y:" + dy + " 지점으로 이동하였습니다.");
	}
}

public class ShapeTest {
	public static void main(String[] args) {
		Movable[] arr = new Movable[3];
		arr[0] = new Rectangle();
		arr[1] = new Circle();
		arr[2] = new Triangle();
		
		Random rnd =  new Random();
		for (Movable m : arr) {
			m.move(rnd.nextInt(101), rnd.nextInt(101));
		}
	}
}


